import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_app/mock/jsonSelf.dart';
import 'package:flutter_html/flutter_html.dart';

class DetailPage  extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _detailState();
  }

}
class _detailState extends State{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
        appBar: PreferredSize(
          preferredSize: Size.fromHeight(44),
          child: AppBar(
            title: Text('详情'),
            centerTitle: true,
          ),
        ),
        body: ListView(
          children:<Widget>[
            Html(
              data: JsonSelf.detailData,
              //Optional parameters:
              padding: EdgeInsets.all(8.0),
              backgroundColor: Colors.white70,
              defaultTextStyle: TextStyle(fontFamily: 'serif',fontSize: 14),
              linkStyle: const TextStyle(
                color: Colors.redAccent,
              ),
              onLinkTap: (url) {
                // open url in a webview
              }
          )
          ],
        )
    );
  }

}